package cn.netshop.pojo.;

import com.alibaba.fastjson.JSONObject;

/**
 * tb_para实体类
 * 
 * @author 
 *
 */
public class TbPara {
	/**id*/
	private Integer id; 
	/**名称*/
	private String name; 
	/**选项*/
	private String options; 
	/**排序*/
	private Integer seq; 
	/**模板ID*/
	private Integer templateId; 
	/**
	 * 实例化
	 */
	public TbPara() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public TbPara(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).intValue());
		}
		if (obj.get("name") instanceof String) {
			this.setName((String) obj.get("name"));
		}
		if (obj.get("options") instanceof String) {
			this.setOptions((String) obj.get("options"));
		}
		if (obj.get("seq") instanceof Number) {
			this.setSeq(((Number) obj.get("seq")).intValue());
		}
		if (obj.get("templateId") instanceof Number) {
			this.setTemplateId(((Number) obj.get("templateId")).intValue());
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getName() != null) {
			result.put("name",this.getName());
		}
		if (this.getOptions() != null) {
			result.put("options",this.getOptions());
		}
		if (this.getSeq() != null) {
			result.put("seq",this.getSeq());
		}
		if (this.getTemplateId() != null) {
			result.put("templateId",this.getTemplateId());
		}
		return result;
	}
	
	
	/**
	 * 获取id
	 * 
	 * @return
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * 设置id
	 * 
	 * @param id
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	
	/**
	 * 获取name
	 * 
	 * @return
	 */
	public String getName() {
		return name;
	}

	/**
	 * 设置name
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * 获取options
	 * 
	 * @return
	 */
	public String getOptions() {
		return options;
	}

	/**
	 * 设置options
	 * 
	 * @param options
	 */
	public void setOptions(String options) {
		this.options = options;
	}
	
	/**
	 * 获取seq
	 * 
	 * @return
	 */
	public Integer getSeq() {
		return seq;
	}

	/**
	 * 设置seq
	 * 
	 * @param seq
	 */
	public void setSeq(Integer seq) {
		this.seq = seq;
	}
	
	/**
	 * 获取templateId
	 * 
	 * @return
	 */
	public Integer getTemplateId() {
		return templateId;
	}

	/**
	 * 设置templateId
	 * 
	 * @param templateId
	 */
	public void setTemplateId(Integer templateId) {
		this.templateId = templateId;
	}

	@Override
	public String toString() {
		return "TbPara [id=" + id + " , name=" + name + " , options=" + options + " , seq=" + seq + " , templateId=" + templateId + "  ]";
	
	}
	
	
}
